#include "stdafx.h"
#include "EntityVisitorCombat.h"
#include "Entity/EntityM.h"
#include "Entity/EntityR.h"



EntityVisitorCombatMonster::EntityVisitorCombatMonster(MsgCombatStartResponse& msg)
:m_msg(msg)
{
}

bool EntityVisitorCombatMonster::visitM(EntityM& e)
{
	MonsterInfo mi;
	mi.eid = e.getID();
	mi.mid = e.getStaticID();
	
	ICombatSys* pCombat = e.getCombatSys();
	if (pCombat)
	{
		mi.hp = pCombat->getHP();
		mi.maxhp = pCombat->getMaxHP();
		mi.mp = pCombat->getMP();
		mi.maxmp = pCombat->getMaxMP();
	}
	return true;
}


EntityVisitorCombatRole::EntityVisitorCombatRole(IEntityManager& ettMgr)
:m_ettMgr(ettMgr)
{
}

bool EntityVisitorCombatRole::visitR(EntityR& e)
{
	m_ettMgr.addEntity(0, &e);
	return true;
}
